package com.use;

public class AccountTest {

    public static void main(String[] args) {

        Account acc = new Account();

        acc.setName("jeckf");
        acc.setPassword("123456");
        acc.setSalay(2000);

        System.out.println(acc.getName()+"  "+acc.getPassword()+"  "+acc.getSalay());
    }

}

class Account{

    public String name;
    private  double salay;
    private String password;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        if(name.length()>2 && name.length()<=6){
            this.name = name;
        }else {
            System.out.println("名字长度不对");
        }

    }

    public double getSalay() {
        return salay;
    }

    public void setSalay(double salay) {

        if(salay>20){
            this.salay = salay;
        }else{
            System.out.println("薪资必须大于20");
        }
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        if(password.length()!=6){
            System.out.println("密码长度不对");
        }
        this.password = password;
    }

//    public Account(String name, double salay, String password) {
//        this.name = name;
//        this.salay = salay;
//        this.password = password;
//    }


}
